# compare vectors
compare_vectors <- function(vec_1 = c(), vec_2 = c()){
  total <- unique(c(vec_1, vec_2))
  in_vec1 <- rep(NA, length(vec_1))
  in_vec2 <- rep(NA, length(vec_2))
  for(i in 1:length(total)){
    if(length(unique(grepl(x = vec_1, pattern = total[i]))) == 2){
      in_vec1[i] <- 1
    }else{
      in_vec1[i] <- 0
    }
    
    if(length(unique(grepl(x = vec_2, pattern = total[i]))) == 2){
      in_vec2[i] <- 1
    }else{
      in_vec2[i] <- 0
    }
  }
  
  results <- rep(NA, length(total))
  
  for(i in 1:length(total)){
    if(in_vec1[i] == 1 & in_vec2[i] == 0){
      results[i] <- 1
    }else if(in_vec1[i] == 0 & in_vec2[i] == 1){
      results[i] <- 2
    }else{
      results[i] <- 3
    }
  }
  return(list(
    total[results == 1],
    total[results == 2],
    total[results == 3]
    ))
}

#### Test Area ####
# compare_vectors(vec_1 = c("a", "b", "c"), vec_2 = c("b", "c", "d"))

